package org.sepheriel.airy2d.shader;

import org.lwjgl.opengl.ARBShaderObjects;
import org.sepheriel.airy2d.math.Vec2;

public class Shock extends PostFX{
	
		float t;
	
		public Shock(Vec2 resolution) {
			super(resolution, "shader/shock.vert", "shader/shock.frag");
			t = 0;
		}
		
		@Override
		public void initVars(int delta) {
			if(t < 1f) {
				t += 0.001f*delta;
			}
			ARBShaderObjects.glUniform2fARB(ARBShaderObjects.glGetUniformLocationARB(shader, "center"), 0.5f, 0.5f);
			ARBShaderObjects.glUniform3fARB(ARBShaderObjects.glGetUniformLocationARB(shader, "shockParams"), 10f, 0.8f, 0.1f);
			ARBShaderObjects.glUniform1fARB(ARBShaderObjects.glGetUniformLocationARB(shader, "time"), t);
		}

}
